<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>教师筛选</title>
    <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0'/>
    <link rel="stylesheet" href="/public/static/css/main.css">
    <link rel="stylesheet" href="/public/static/css/pickout.css">
</head>

<body>
<div class="main-container">
    <div class="main-wrapper">
        <section class="section teacher-section">
            <div id="model" class="form" >

                <div class="row section-header ">
                    <img src="/public/static/images/head.jpg" style="width: 70px; height: 70px; border-radius: 50px;">
                    <div class="column">
                        <div class="teacher-name">{$code}</div>
                        <div class="teacher-belong">{$name}</div>
                    </div>
                </div>
                <form action="{:url('rollCall')}" method="post">
                <div class="input-group resize">
                    <input type="text" name="input-code"  style="color: #4E4E4E;" disabled="" value="{$code}">
                </div>
                <div class="input-group resize">
                    <select name="className" id="className" class="className pickout" placeholder="请选择班级: ">
                        <!-- .... -->
                    </select>
                </div>

                <div class="input-group resize">
                    <select name="classTime" id="classTime" class="classTime pickout" placeholder="请选择点名时间段: ">
                        <option value="早课">早课</option>
                        <option value="晚课">晚课</option>
                    </select>
                </div>
                    <input type="submit" class="submit-btn resize" value="筛选"/>
                <!--<button id="screening-btn" class="submit-btn resize" type="button" data-for-form="model">筛选</button>-->
                </form>

            </div>
        </section>
    </div>
</div>
<script src="/public/vendor/jquery-1.10.2.min.js" charset="utf-8"></script>
<script src="/public/vendor/layer/mobile/layer.js" charset="utf-8"></script>
<script src="/public/vendor/jweixin-1.0.0.js" charset="utf-8"></script>
<script src="/public/static/js/main.js" charset="utf-8"></script>
<script src="/public/vendor/pickout.min.js" charset="utf-8"></script>
<script>

    $.ajax({
        //获取班级信息
        url: 'http://callname.tunnel.echomod.cn/index/classInfo',
        data:{},
        type:'GET',
        dataType: 'json',
        contentType: 'application/json',
        success: function(res) {
            console.log(res)
            var $className = $('#className')
            for (var i = 0; i < res.length; i++) {

                $className.append('<option data-id="' + res[i].ID + '" value="'+res[i].ID+'">' + res[i].Name + '</option>')
            }
        }
    })

    function lalert(msg) {
        layer.open({
            content: msg,
            skin: 'msg',
            time: 2
        });
    }
    localStorage.setItem("name","张三");
    //$.ajax({
    //   url: ,
    //   data:{
    //     number:
    //   },
    //   type:'GET',
    //   dataType: 'json',
    //   contentType: 'application/json'
    //   success: function(res) {
    //     lalert('短信已经发出')
    //   }
    // })


    //$('input[name = input-code]').val('Masyn');

    // Preparar o select
    //pickout.to('.pickout');
//    var $className = $('#className');
//    var $classTime = $('#classTime');
//    $('#screening-btn').on('click',function () {
//        var classNameVal = $className.find('option[selected = selected]').val();
//        var classTimeVal = $classTime.find('option[selected = selected]').val();
//        lalert(classNameVal + classTimeVal);
//        window.location.replace(window.location.origin +'/muster/parLogin/rollCall.html' + '?code=天津触手科技&className=' + classNameVal + '&classTime=' + classTimeVal);
//    })


    pickout.to({
        el:'.className',
        theme: 'clean',
        search: true
    });
    pickout.to({
        el:'.classTime',
        theme: 'clean',
        search: false
    });

    // pickout.updated('.className');


</script>
</body>
</html>
